package com.cuij.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cuij.entity.Result;
import com.cuij.service.orderUserService;

@Controller
@RequestMapping("/user")
public class orderUserController {

    @Resource
    private orderUserService orderuserservice;

    // 登录
    @RequestMapping("/login.do")
    @ResponseBody
    public Result loginExecute(String use_name, String use_pwd, String cust_type) throws Exception {
        Result result = orderuserservice.login(use_name, use_pwd, cust_type);
        return result;
    }

    // 注册
    @RequestMapping("/custresign.do")
    @ResponseBody
    public Result custresignExecute(String use_name, String use_pwd) throws Exception {
        Result result = orderuserservice.custsave(use_name, use_pwd);
        return result;
    }

    // 商家注册
    @RequestMapping("/busiresign.do")
    @ResponseBody
    public Result busiresignExecute(String use_name, String use_pwd, String busi_name, String busi_pic,
            String busi_type, String busi_linkname, String busi_linkphone, String busi_address) throws Exception {
        Result result = orderuserservice.busisave(use_name, use_pwd, busi_name, busi_pic, busi_type, busi_linkname,
                busi_linkphone, busi_address);
        return result;

    }

    // 修改密码
    @RequestMapping("/changepwd.do")
    @ResponseBody
    public Result changePwdExecute(String use_id, String old_pwd, String new_pwd) {
        Result result = orderuserservice.changepwd(use_id, old_pwd, new_pwd);
        return result;
    }

}
